home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Science / RLaB / help / svd < prev    next >
Text File  |  1994-04-25  |  1KB  |  48 lines

  1. svd:
  2.  
  3. Syntax:    svd ( A )
  4.     svd ( A , TYPE )
  5.  
  6. Description:
  7.  
  8.     Computes the singular values of the input matrix A, as well as
  9.     the right and left singular vectors in various forms. Where:
  10.  
  11.         A = U * diag (sigma) * Vt
  12.  
  13.     The output is a list containing the three afore-mentioned
  14.     objects (u, sigma, vt).  Various forms of the right and left
  15.     singular vectors can be computed, depending upon the value of
  16.     the second argument, TYPE.
  17.  
  18.     TYPE:    `"S"'    A minimal version of U, and V' are returned.
  19.             This is the default.
  20.     TYPE:    `"A"'    The full U, and V' are returned.
  21.     TYPE:    `"N"'    U and V' are not computed, empty U and V' are
  22.             returned. 
  23.  
  24.     The LAPACK subroutine DGESVD, or ZGESVD is used to perform the
  25.     computation.
  26.  
  27.     Example:
  28.  
  29.     > A = [0.96, 1.72; 2.28, 0.96];
  30.     > Asvd = svd(A)
  31.        sigma        u            vt
  32.     > Asvd.vt
  33.      matrix columns 1 thru 2
  34.             -0.8        -0.6
  35.              0.6        -0.8
  36.     > Asvd.u
  37.      matrix columns 1 thru 2
  38.             -0.6        -0.8
  39.             -0.8         0.6
  40.     > Asvd.sigma
  41.      vector elements 1 thru 2
  42.                3           1
  43.     > check = Asvd.u * diag(Asvd.sigma) * Asvd.vt
  44.      check =
  45.      matrix columns 1 thru 2
  46.             0.96        1.72
  47.             2.28        0.96
  48.